{% extends 'layout.html' %}


{% block content %}
    <form action="" method="post" novalidate>
        {% csrf_token %}
        {% for foo in form %}
            <!-- 子绝父相 -->
            <div class="form-group" style="position: relative">
                {{ foo.label_tag }}
                <!-- 添加help_text -->
                {% if foo.help_text %}
                    <span class="text-primary">（{{ foo.help_text }}）</span>
                {% endif %}
                {{ foo }}
                <span style="position: absolute; color: red">{{ foo.errors.0 }}</span>
            </div>
        {% endfor %}
        <input type="submit" class="btn btn-success" value="提交" style="margin-top: 10px">
    </form>
{% endblock %}